/*
** my_strcapitalize.c for my_strcapitalize in /home/chassa_m/rendu/Piscine-C-Jour_06/ex_09
** 
** Made by chassa_m
** Login   <chassa_m@epitech.net>
** 
** Started on  Mon Oct  7 17:32:25 2013 chassa_m
** Last update Wed Oct  9 14:51:44 2013 chassa_m
*/

int	low_to_up(char *str, int i)
{
  if (str[i + 1] >= 97 && str[i + 1] < 123)
    {
      str[i + 1] = str[i + 1] - 32;
    }
}

char	*my_strcapitalize(char *str)
{
  int	i;

  i = 1;
  if (str[0] >= 97 && str[0] < 123)
    {
      str[0] = str[0] - 32;
    }
  while (str[i] != 0)
    {
      if (str[i] < 39 || (str[i] > 39 && str[i] < 48))
	{
	  low_to_up(str, i);
	}
      else if (str[i] > 57 && str[i] < 65)
	{
	  low_to_up(str, i);
	}
      else if ((str[i] > 90 && str[i] < 97) || str[i] > 122)
	{
	  low_to_up(str, i);
	}
      i = i + 1;
    }
  return (str);
}
